package com.bfly.mall.order.dto;

import com.alibaba.fastjson.annotation.JSONField;
import com.bfly.mall.order.entity.OrderLogs;
import com.bfly.mall.order.enums.ExpressStatusEnum;
import com.bfly.mall.order.enums.OrderStatusEnum;
import com.bfly.mall.order.enums.PayStatusEnum;
import com.bfly.mall.order.enums.PayTypeEnum;
import com.bfly.mall.product.enums.ProductActivityTypeEnum;
import com.bfly.mall.product.enums.ShippingMethodEnum;
import com.bfly.mall.user.dto.UserNameDTO;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 订单详情DTO
 *
 * @author 长沙商脉科技有限公司
 * @date 2020/9/15 21:10
 */
public class OrderDTO implements Serializable {

    private static final long serialVersionUID = 2435658119777611390L;

    private String orderNo;
    private String tradeNo;
    private BigDecimal productPrice;
    private BigDecimal payPrice;
    private BigDecimal discountPrice;
    private BigDecimal expressPrice;
    private int orderStatus;
    private int payStatus;
    private int expressStatus;
    private int dispatchId;

    @JSONField(serialize = false)
    private int payType;
    private String remark;
    private List<OrderSkuListDTO> skus;
    private List<OrderLogs> logs;
    private OrderAddressDTO address;
    private List<OrderExpressDTO> express;
    private UserNameDTO user;
    private int activityType;

    public String getActivityTypeName(){
        ProductActivityTypeEnum activityTypeEnum=ProductActivityTypeEnum.getActivityType(getActivityType());
        return activityTypeEnum==null?"":activityTypeEnum.getName();
    }

    public String getDispatchName() {
        ShippingMethodEnum dispatchEnum = ShippingMethodEnum.getShippingMethod(getDispatchId());
        return dispatchEnum == null ? "" : dispatchEnum.getName();
    }

    public String getOrderStatusName() {
        OrderStatusEnum status = OrderStatusEnum.getStatus(getOrderStatus());
        return status == null ? "" : status.getName();
    }

    public String getPayStatusName() {
        PayStatusEnum status = PayStatusEnum.getStatus(getPayStatus());
        return status == null ? "" : status.getName();
    }

    public String getExpressStatusName() {
        ExpressStatusEnum status = ExpressStatusEnum.getStatus(getExpressStatus());
        return status == null ? "" : status.getName();
    }

    public String getPayTypeName() {
        PayTypeEnum type = PayTypeEnum.getStatus(getPayType());
        return type == null ? "" : type.getName();
    }

    public int getActivityType() {
        return activityType;
    }

    public void setActivityType(int activityType) {
        this.activityType = activityType;
    }

    public int getDispatchId() {
        return dispatchId;
    }

    public void setDispatchId(int dispatchId) {
        this.dispatchId = dispatchId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public void setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
    }

    public BigDecimal getProductPrice() {
        return productPrice;
    }

    public void setProductPrice(BigDecimal productPrice) {
        this.productPrice = productPrice;
    }

    public BigDecimal getPayPrice() {
        return payPrice;
    }

    public void setPayPrice(BigDecimal payPrice) {
        this.payPrice = payPrice;
    }

    public BigDecimal getDiscountPrice() {
        return discountPrice;
    }

    public void setDiscountPrice(BigDecimal discountPrice) {
        this.discountPrice = discountPrice;
    }

    public BigDecimal getExpressPrice() {
        return expressPrice;
    }

    public void setExpressPrice(BigDecimal expressPrice) {
        this.expressPrice = expressPrice;
    }

    public int getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        this.orderStatus = orderStatus;
    }

    public int getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(int payStatus) {
        this.payStatus = payStatus;
    }

    public int getExpressStatus() {
        return expressStatus;
    }

    public void setExpressStatus(int expressStatus) {
        this.expressStatus = expressStatus;
    }

    public int getPayType() {
        return payType;
    }

    public void setPayType(int payType) {
        this.payType = payType;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public List<OrderSkuListDTO> getSkus() {
        return skus;
    }

    public void setSkus(List<OrderSkuListDTO> skus) {
        this.skus = skus;
    }

    public List<OrderLogs> getLogs() {
        return logs;
    }

    public void setLogs(List<OrderLogs> logs) {
        this.logs = logs;
    }

    public OrderAddressDTO getAddress() {
        return address;
    }

    public void setAddress(OrderAddressDTO address) {
        this.address = address;
    }

    public List<OrderExpressDTO> getExpress() {
        return express;
    }

    public void setExpress(List<OrderExpressDTO> express) {
        this.express = express;
    }

    public UserNameDTO getUser() {
        return user;
    }

    public void setUser(UserNameDTO user) {
        this.user = user;
    }
}
